﻿using ExcelUnity.Exporter.CompleteCustomer;
using ExcelUnity.Exporter.Styles;
using NPOI.SS.UserModel;

namespace ExcelUnity.Exporter.Exporters
{
    /// <summary>
    /// 自定义工作簿单元格
    /// </summary>
    public class ExportCustomerSheetCell
    {
        public ExportCustomerSheetCell(int row, int column, string value, CellType cellType = CellType.String, BaseDetailCellStype? baseCellStype = null, CustomerMergeConfigDto? mergeConfig = null)
        {
            Row = row;
            Column = column;
            Value = value;
            CellType = cellType;
            MergeConfig = mergeConfig;
            BaseCellStype = baseCellStype;
        }

        public ExportCustomerSheetCell(int row, int column, string value, int heigth, CellType cellType = CellType.String, BaseDetailCellStype? baseCellStype = null, CustomerMergeConfigDto? mergeConfig = null)
        {
            Row = row;
            Column = column;
            Value = value;
            Heigth = heigth > 1 ? heigth : 0;
            CellType = cellType;
            BaseCellStype = baseCellStype;
            MergeConfig = mergeConfig;
        }

        /// <summary>
        /// 行
        /// </summary>
        public int Row { get; }

        /// <summary>
        /// 列
        /// </summary>
        public int Column { get; }

        /// <summary>
        /// 单元格的值
        /// </summary>
        public string Value { get; }

        /// <summary>
        /// 单元数据格式
        /// </summary>
        public CellType CellType { get; }

        /// <summary>
        /// 行高
        /// </summary>
        public int Heigth { get; set; }

        /// <summary>
        /// 样式
        /// </summary>
        public BaseDetailCellStype? BaseCellStype { get; set; }

        /// <summary>
        /// 合并配置
        /// </summary>
        public CustomerMergeConfigDto? MergeConfig { get; set; }
    }
}